import request from '@/utils/request'

// 获取路由
export function getRecently() {
  return request({
    url: '/articles/topAndFeatured',
    method: 'get'
  })
}
export function getArchives() {
  return request({
    url: '/archives/all',
    method: 'get'
  })
}
export function getLiftRecently() {
  return request({
    url: '/articles/recently',
    method: 'get'
  })
}
/**
 * 发送 GET 请求获取所有文章
 * 该函数向 /articles/all 发送 GET 请求
 * @returns {Promise} 请求的 Promise 对象
 */
export function getAllArticles() {
  return request({
    url: '/articles/all',
    method: 'get'
  })
}

export function getArticleById(categoryId) {
  return request({
    url: '/articles/categoryId',
    method: 'get',
    params: {
      categoryId
    }
  })
}
export function getOneByArticleId(articleId) {
  return request({
    url: '/articles/' + articleId,
    method: 'get',
  })
}

export function getListByTagId(tagId) {
  return request({
    url: '/articles/tagId',
    method: 'get',
    params: {
      tagId
    }

  })
}